package com.itheima.service.serviceimpl;

import com.itheima.dao.UserDao;
import com.itheima.pojo.Menu;
import com.itheima.pojo.Permission;
import com.itheima.pojo.Role;
import com.itheima.pojo.User;
import com.itheima.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;
    @Override
    public User findByUsername(String username) {
        return userDao.findByUsername(username);
    }

    @Override
    public List<Role> loadRolesByUserId(Integer id) {
        return userDao.loadRolesByUserId(id);
    }

    @Override
    public Set<Permission> getPermissions(Integer id) {
        return userDao.getPermissions(id);
    }

    @Override
    public LinkedHashSet<Menu> getMenus(Integer id) {
        return userDao.getMenus(id);
    }


}
